#ifndef LOMERRORSHH
#define LOMERRORSHH
#include "stdincludes.hh"
#include "lom-typedefs.hh"
#include "errors.hh"

namespace lom
{
    class LomError : public licada::LicadaError
    {
    public:
	LomError(){}
	virtual ~LomError() throw() {}
    };
    class NameError : public LomError
    {
	licada::TNameStr name;
    public:
	NameError( const licada::TNameStr& _name ) : LomError(), name( _name ){}
	virtual ~NameError() throw(){}
	licada::TNameStr getName() const { return name; }
    };
    
    class NameNotFound : public NameError
    {
    public:
	NameNotFound( const licada::TNameStr& _n ) : NameError( _n ){}
	virtual ~NameNotFound() throw(){}
    };
    class InstanceNotFound : public LomError
    {
	THandle handle;
    public:
	InstanceNotFound( THandle _hdl ) : LomError(), handle(_hdl){}
	virtual ~InstanceNotFound() throw() {}
	THandle getHandle() const { return handle; }
    };
    
    class HandleExists : public LomError
    {
    public:
	virtual ~HandleExists() throw() {}
    };
    
    class ReservedHandleDoesNotExist : public LomError
    {
    public:
	virtual ~ReservedHandleDoesNotExist() throw (){}
    };

    
    class MissingProperty : public NameError
    {    
    public:
	MissingProperty( const licada::TNameStr& _n ) : NameError( _n ){}
	virtual ~MissingProperty() throw() {}
    };
    
    class DuplicateClassName : public NameError
    {
    public:
	DuplicateClassName( const licada::TNameStr& _n ) : NameError( _n ){}
	virtual ~DuplicateClassName() throw() {}
    };
    
    class MissingClassName : public NameError
    {
    public:
	MissingClassName( const licada::TNameStr& _n ) : NameError( _n ){}
	virtual ~MissingClassName() throw() {}
    };
    
    class UnrecognizedDatatype : public LomError
    {
	EDataType type;
    public:
	UnrecognizedDatatype( EDataType _t ) : type( _t ){}
	virtual ~UnrecognizedDatatype() throw() {}
	EDataType getType() { return type; }
    };
    
    class DatatypeMismatch : public LomError
    {
    public:
	virtual ~DatatypeMismatch() throw() {}
    };
    
    class LomValueFactoryAllocationError : public LomError
    {
    public:
	virtual ~LomValueFactoryAllocationError() throw (){}
    };
    
    class UnrecognizedTransactionEventType : public LomError
    {
	ETransactionEventType eventType;
    public:
	UnrecognizedTransactionEventType( ETransactionEventType _type )
	    : eventType( _type ){}
	virtual ~UnrecognizedTransactionEventType() throw (){}
	ETransactionEventType getEventType() { return eventType; }
    };
    
    class TransactionAlreadyOpened : public LomError
    {
    public:
	virtual ~TransactionAlreadyOpened() throw() {}
    };
    class LomValueDeletionWithNoFactory : public LomError
    {
    public:
	virtual ~LomValueDeletionWithNoFactory() throw (){}
    };
    class InvalidLomTransactionSystemState : public LomError
    {
    public:
	virtual ~InvalidLomTransactionSystemState() throw() {}
    };
}

#endif
